﻿#region Header
// ------------------------ Licence / Copyright ------------------------
// 
// ScrumTable for Scrum Meeting Support
// Copyright © HSR - Hochschule für Technik Rapperswil
// All Rights Reserved
// 
// Author:
//  Michael Gfeller Silvan Gehrig Patrick Boos
// 
// ---------------------------------------------------------------------
#endregion

#region Usings

using System;
using System.Collections.Generic;
using ScrumTable.Common;
using ScrumTable.Common.Collections;

#endregion


namespace ScrumTable.DL.Data.Generic.Cache
{
    /// <summary>
    /// This class wraps a report instance.
    /// </summary>
    public class CacheReport : CacheElementBase
    {
        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------

        #endregion

        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------

        /// <summary>
        /// Specifies the Uri of a report.
        /// </summary>
        public string Path { get; private set; }

        /// <summary>
        /// Specifies the full report Uri.
        /// </summary>
        public Uri FullPath { get; private set; }

        /// <summary>
        /// Gets the post command arguments which must be used to call
        /// the report Uri specified in by the FullPath argument.
        /// </summary>
        public string PostCommandArguments { get; private set; }

        /// <summary>
        /// Gets the allowed values for this report.
        /// </summary>
        public ICacheElementList<CacheFieldDefinition<NamedValue>> FieldDefinitions { get; private set; }

        #endregion

        #region Constructors / Destructor
        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------

        /// <summary>
        /// Creates a new CacheReport instance. This constructor is used in
        /// the current library only.
        /// </summary>
        internal CacheReport(
            string unqiueId,
            string name,
            string path,
            Uri fullPath,
            string postCommandArguments,
            IEnumerable<CacheFieldDefinition<NamedValue>> fieldDefinitions)
            : base(unqiueId, CacheIdentity.DefaultId, name, CacheIdentity.DefaultRevision)
        {
            Path = path ?? string.Empty;
            FullPath = fullPath ?? UriUtil.Empty;
            PostCommandArguments = postCommandArguments ?? string.Empty;
            FieldDefinitions = new CacheElementList<CacheFieldDefinition<NamedValue>>(fieldDefinitions, this);
        }

        #endregion

        #region Methods
        //--------------------------------------------------------------------
        // Methods
        //--------------------------------------------------------------------

        #endregion

        #region Events
        //--------------------------------------------------------------------
        // Events
        //--------------------------------------------------------------------

        #endregion
    }
}